package com.ruoyi.labdata.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.labdata.domain.LabBlacklistPersonnel;
import com.ruoyi.labdata.service.ILabBlacklistPersonnelService;

/**
 * 实验室黑名单人员Controller
 * 
 * @author ruoyi
 * @date 2022-04-02
 */
@RestController
@RequestMapping("/labdata/blackPersonnel")
public class LabBlacklistPersonnelController extends BaseController {
	@Autowired
	private ILabBlacklistPersonnelService labBlacklistPersonnelService;


	/**
	 * 获取实验室黑名单人员详细信息
	 */
	// @PreAuthorize("@ss.hasPermi('labdata:blackPersonnel:query')")
	@GetMapping(value = "/{id}")
	public AjaxResult getInfo(@PathVariable("id") Long id) {
		return AjaxResult.success(labBlacklistPersonnelService.selectLabBlacklistPersonnelById(id));
	}


	/**
	 * 修改实验室黑名单人员
	 */
	// @PreAuthorize("@ss.hasPermi('labdata:blackPersonnel:edit')")
	@Log(title = "实验室黑名单人员", businessType = BusinessType.UPDATE)
	@PutMapping
	public AjaxResult edit(@RequestBody LabBlacklistPersonnel labBlacklistPersonnel) {
		return toAjax(labBlacklistPersonnelService.updateLabBlacklistPersonnel(labBlacklistPersonnel));
	}

}
